//using System.Collections;
//using System.Collections.Generic;
//using UnityEngine;
//using cframework_xlua;
//using System.ComponentModel;
//using Newtonsoft.Json;
//using UnityEditor;

//[CreateAssetMenu(menuName = "cframework_xlua/AndroidKeyStoreUtil")]
//public class AndroidKeyStoreUtil : ScriptableObject
//{
//    public bool useCustomKeystore = true;
//    public TextAsset keystoreFile;
//    public string keystorePassword;
//    public string keyaliasName;
//    public string keyaliasPassword;

//    public void SetKeyStore(bool enable)
//    {
//        if(!useCustomKeystore || keystoreFile == null || !enable)
//        {
//            UnityEditor.PlayerSettings.Android.useCustomKeystore = false;
//        }
//        else
//        {
//            UnityEditor.PlayerSettings.Android.useCustomKeystore = true;
//            UnityEditor.PlayerSettings.Android.keystoreName = keyStoreFullPath;
//            UnityEditor.PlayerSettings.Android.keystorePass = keystorePassword;
//            UnityEditor.PlayerSettings.Android.keyaliasName = keyaliasName;
//            UnityEditor.PlayerSettings.Android.keyaliasPass = keyaliasPassword;
//        }
//    }

//    public string keyStoreFullPath
//    {
//        get
//        {
//            return AssetDatabase.GetAssetPath(keystoreFile);
//        }
//    }


//    public bool CreateKeyStoreFile(string java_home)
//    {

//        string dirPath = System.IO.Path.GetDirectoryName(keyStoreFullPath);

//        if(!System.IO.Directory.Exists(dirPath))
//        {
//            System.IO.Directory.CreateDirectory(dirPath);
//        }


//        var ret = CommandLineTool.RunCommand2($"{java_home}/bin/keytool", $"-genkey -validity 2000 -keyalg RSA -dname \"CN = Test, OU = Test, O = Test, L = Test, S = Test, C = Test\" -keystore {keyStoreFullPath} -storepass {keystorePassword} -alias {keyaliasName} -keypass {keyaliasPassword}", System.IO.Path.GetDirectoryName(Application.dataPath));

//        if (ret.ExitCode != 0)
//        {
//            Debug.LogError("output: " + ret.StdOut);
//            Debug.LogError("error: " + ret.StdErr);
//            return false;
//        }

//        return true;
//    }
//}
